﻿//********************************************************************************//
//创建日期：<创建日期，2016-10-12>
//创建作者：<孙雪婷，sunxueting@shanghai3h.com>
//功能说明：打印账单
//废弃 by guodengjie at 20170829 
//replaced by DaYinZD.html
//********************************************************************************//
using BLL;
using BLL.Access;
using DevExpress.Web;
using Entity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web.Class;


namespace Web.Pages.QuShui.DiXiaS.ShouFeiGL
{
    public partial class DaYinZD : BasePage
    {
        #region 属性

        /// <summary>
        /// 保存结果集1
        /// </summary>
        private DataTable dtGridTab1
        {
            get
            {
                return ViewState["dtGridTab1"] as DataTable;
            }
            set
            {
                ViewState["dtGridTab1"] = value;
            }
        }

        /// <summary>
        /// 保存结果集2
        /// </summary>
        private DataTable dtGridTab2
        {
            get
            {
                return ViewState["dtGridTab2"] as DataTable;
            }
            set
            {
                ViewState["dtGridTab2"] = value;
            }
        }

        /// <summary>
        /// 保存结果集3
        /// </summary>
        private DataTable dtGridTab3
        {
            get
            {
                return ViewState["dtGridTab3"] as DataTable;
            }
            set
            {
                ViewState["dtGridTab3"] = value;
            }
        }
      
        #endregion

        #region 变量

        /// <summary>
        /// 数据访问操作类
        /// </summary>
        SpHelper _SpHelper = new SpHelper();
        

        #endregion

        #region 事件

        /// <summary>
        /// 页面加载事件
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            //第一次页面加载
            if (!IsPostBack)
            {
                InitData();
            }

        }




        /// <summary>
        /// TAB1查询数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        protected void btnChaXunTab1_Click(object sender, EventArgs e)
        {
            int ym =txtShuiLiangYMTab3.Text!=""? Convert.ToInt32(txtShuiLiangYMTab3.Text):0;
            string yhh = txtYongHuHTab3.Text!=""?txtYongHuHTab3.Text:"";
            string time=deDaYinRQ1.Text!=""?deDaYinRQ3.Text.ToString() :"";
            if (ym!=0&&yhh != ""&&time!="")
            {
                dtGridTab1 = _SpHelper.P_QSSF_DAYINZD(ym, yhh, time).Tables[0];
                gvGridTab1.DataSource = dtGridTab1;
                gvGridTab1.DataBind();
            }
        }

        /// <summary>
        /// tab3查询数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnChaXuntab3_Click(object sender, EventArgs e)
        {

        }


        #endregion

        #region 方法

        /// <summary>
        /// 初始化数据
        /// </summary>
        private void InitData()
        {
            int wtype = 2;
            deDaYinRQ1.Text = DateTime.Now.ToString("yyyy-MM-dd");
            deDaYinRQ2.Text = DateTime.Now.ToString("yyyy-MM-dd");
            deDaYinRQ3.Text = DateTime.Now.ToString("yyyy-MM-dd");
            gvGridTab1.SettingsPager.Mode = GridViewPagerMode.EndlessPaging;
            gvGridTab3.SettingsPager.Mode = GridViewPagerMode.EndlessPaging;
            //水量年月
            string water_y_m = BusinessTool.GetSLYMorZWNY(1, wtype).ToString();

            //业务员
            //LoadYWY();
            txtShuiLiangYM.Text = water_y_m;

        }
       

        

        #endregion
       

       
    }
}